<%@ include file="/common/taglibs.jsp"%>

<head>
    <title><fmt:message key="transactionList.title"/></title>
    <meta name="heading" content="<fmt:message key='transactionList.heading'/>"/>
    <meta name="menu" content="TransactionMenu"/>
</head>

<div id="search">
<form method="get" action="${ctx}/transactions" id="searchForm">
    <input type="text" size="20" name="q" id="query" value="${param.q}"
           placeholder="Enter search terms..."/>
    <input type="submit" value="<fmt:message key="button.search"/>"/>
</form>
</div>

<input type="button" style="margin-right: 5px" class="button" onclick="location.href='<c:url value="/editTransaction"/>'" value="<fmt:message key="button.add"/>"/>
<input type="button" class="button" onclick="location.href='<c:url value="/mainMenu"/>'" value="<fmt:message key="button.done"/>"/>

<display:table name="transactions" class="table" requestURI="" id="transactionList" export="true" pagesize="25">
    <display:column property="id" sortable="true" href="editTransaction" media="html"
        paramId="id" paramProperty="id" titleKey="transaction.id"/>
    <display:column property="id" media="csv excel xml pdf" titleKey="transaction.id"/>
    <display:column property="clientId" sortable="true" titleKey="transaction.clientId"/>
    <display:column sortProperty="clientupdated" sortable="true" titleKey="transaction.clientupdated">
        <input type="checkbox" disabled="disabled" <c:if test="${transactionList.clientupdated}">checked="checked"</c:if>/>
    </display:column>
    <display:column property="deadline" sortable="true" titleKey="transaction.deadline"/>
    <display:column property="editorId" sortable="true" titleKey="transaction.editorId"/>
    <display:column sortProperty="editorupdated" sortable="true" titleKey="transaction.editorupdated">
        <input type="checkbox" disabled="disabled" <c:if test="${transactionList.editorupdated}">checked="checked"</c:if>/>
    </display:column>
    <display:column property="finishtime" sortable="true" titleKey="transaction.finishtime"/>
    <display:column property="payed" sortable="true" titleKey="transaction.payed"/>
    <display:column property="payment" sortable="true" titleKey="transaction.payment"/>
    <display:column property="paytype" sortable="true" titleKey="transaction.paytype"/>
    <display:column property="remark" sortable="true" titleKey="transaction.remark"/>
    <display:column property="schoolNum" sortable="true" titleKey="transaction.schoolNum"/>
    <display:column property="serviceId" sortable="true" titleKey="transaction.serviceId"/>
    <display:column property="showId" sortable="true" titleKey="transaction.showId"/>
    <display:column property="starttime" sortable="true" titleKey="transaction.starttime"/>
    <display:column property="status" sortable="true" titleKey="transaction.status"/>

    <display:setProperty name="paging.banner.item_name"><fmt:message key="transactionList.transaction"/></display:setProperty>
    <display:setProperty name="paging.banner.items_name"><fmt:message key="transactionList.transactions"/></display:setProperty>

    <display:setProperty name="export.excel.filename"><fmt:message key="transactionList.title"/>.xls</display:setProperty>
    <display:setProperty name="export.csv.filename"><fmt:message key="transactionList.title"/>.csv</display:setProperty>
    <display:setProperty name="export.pdf.filename"><fmt:message key="transactionList.title"/>.pdf</display:setProperty>
</display:table>

<input type="button" style="margin-right: 5px" class="button" onclick="location.href='<c:url value="/editTransaction"/>'" value="<fmt:message key="button.add"/>"/>
<input type="button" class="button" onclick="location.href='<c:url value="/mainMenu"/>'" value="<fmt:message key="button.done"/>"/>

<script type="text/javascript">
    highlightTableRows("transactionList");
</script>
